package com.java.gui;

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class GridLayoutTest {

	public static void main(String[] args) {
		JFrame jf=new JFrame("网格布局");
		jf.setLayout(new GridLayout(2,3));
		for(int i=0;i<6;i++){
			jf.add(new JButton("Button_"+i));
			
		}
		jf.setSize(400, 300);
		jf.setVisible(true);
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

}
